<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>
        var salary = 0
        while(true){
            var op = prompt('`请选择你的操作：\n1.取款\n2.存款\n3.查看余额\n4.退出`')
            if (op == 1) {
                var amount = prompt('请输入你的取款金额')
                if (+amount > salary){
                    alert('你的余额不足，不能取款')
                    continue
                }
                else{
                    salary = salary - (+amount)
                    alert('取款成功')
                }
            } else if(op == 2) {
                var amount = prompt('请输入你的存款金额')
                salary += (+amount)
                alert('存款成功')
            } else if(op == 3){
                alert(`你的余额是${salary}元`)
            } else{
                alert('退出成功')
                break
            }
        }
    </script>

</head>
<body>
    
</body>
</html>